<template>
  <div slot="table">
      <span style="padding-bottom: 20px">共{{total}}人参赛</span>
      <el-table border v-loading="loading" :data="pInformationList" >
          <el-table-column label="序号" align="center" prop="id" />
          <el-table-column  v-if="this.$store.state.user.name == 'admin'" label="用户名" align="center" prop="createUsername" />
          <el-table-column label="选手姓名" align="center" prop="name" >
            <template slot-scope="scope">
              <el-link  style="color: blue">{{scope.row.name}}</el-link>
            </template>
          </el-table-column>
          <el-table-column label="个人证件照" align="center" prop="imageName" width="150px" >
            <template slot-scope="scope">
              <image-preview :src="scope.row.imageName" :width="100" :height="100"/>
            </template>
          </el-table-column>
          <el-table-column label="国籍" align="center" prop="country" />
          <el-table-column label="所在赛区" align="center" prop="locatedArea" >
            <template slot-scope="scope">
              {{scope.row.locatedArea == '1' ? '北京赛区':scope.row.locatedArea == '2' ? '北京延庆赛区':scope.row.locatedArea == '3' ? '张家口赛区':'--' }}
            </template>
          </el-table-column>
          <el-table-column label="比赛场地" align="center" prop="competitionVenue" :formatter="formatterCompetitionVenue"/>
          <el-table-column label="项目名称" align="center" prop="projectName" :formatter="projectNameFormatter" >
          </el-table-column>
          <el-table-column label="项目种类" align="center" prop="projectType">
            <template slot-scope="scope">
              {{scope.row.projectType == 1 ? '单人赛':scope.row.projectType == 2 ? '双人赛':'团体赛' }}
            </template>
          </el-table-column>
          <el-table-column label="报名时间" prop="createTime"/>
      </el-table>
  </div>

</template>

<script>
import { listQueryViewProgress } from "@/api/system/progress";
export default {
  name: "evenProjectDetail",
  data(){
    return {
      loading:false,
      pInformationList:[],
      queryParams:{},
    }
  },
  created(){
    this.getList()
  },
  methods:{
    total:null,
    //比赛场地
    formatterCompetitionVenue(row,cloumn){
      switch(row.competitionVenue){
        case '1':
          return '首都体育馆';
          break;
        case '2':
          return '国家速滑馆';
          break;
        case '3':
          return '国家体育馆';
          break;
        case '4':
          return '五棵松体育中心';
          break;
        case '5':
          return '国家游泳中心';
          break;
        case '6':
          return '首钢滑雪大跳台中心';
          break;
        case '7':
          return '国家雪车雪橇中心';
          break;
        case '8':
          return '国家高山滑雪中心';
          break;
        case '9':
          return '云顶滑雪公园';
          break;
        case '10':
          return '国家跳台滑雪中心';
          break;
        case '11':
          return '国家越野滑雪中心';
          break;
        case '12':
          return '国家冬季两项中心';
          break;
        default:
          return '未知';
      }
    },
    //项目名称
    projectNameFormatter(row,cloumn){
      switch(row.projectName){
        case '1':
          return '短道速滑';
          break;
        case '2':
          return '速度滑冰';
          break;
        case '3':
          return '花样滑冰';
          break;
        case '4':
          return '冰球';
          break;
        case '5':
          return '冰壶';
          break;
        case '6':
          return '雪车';
          break;
        case '7':
          return '钢架雪车';
          break;
        case '8':
          return '雪橇';
          break;
        case '9':
          return '冬季两项';
          break;
        case '10':
          return '高山滑雪';
          break;
        case '11':
          return '自由式滑雪';
          break;
        case '12':
          return '单板滑雪';
          break;
        case '13':
          return '跳台滑雪';
          break;
        case '14':
          return '越野滑雪';
          break;
        case '15':
          return '北欧两项';
          break;
        default:
          return '未知';
      }
    },
    //查询接口
    getList(){
      const self = this
      self.loading = true;
      debugger
      self.queryParams.id = self.$route.query.id
      self.queryParams.locatedArea = self.$route.query.locatedArea
      self.queryParams.competitionItems = self.$route.query.competitionItems
      self.queryParams.competitionVenue = self.$route.query.competitionVenue
      listQueryViewProgress(self.queryParams).then(response => {
        self.pInformationList = response.data;
        self.total = response.data.length;
        self.loading = false;
      });

    }
  }
}
</script>

<style scoped>

</style>
